package com.yzs.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yzs.utils.MD5Util;
import com.yzs.utils.TimeUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 管理员表
 */

@TableName("t_admin")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Admin {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String username;
    private String password;
    private String createTime;
    private String loginTime;
    private String role;
    private String name;
    private String registerUsername;
    private String registerName;
    private String adminStatus;
    private String phone;

    public Admin(Personnel p){
        this.id = p.getId();
        this.username = p.getUsername();
        this.name = p.getName();
        this.password = MD5Util.GetMD5Code(p.getUsername()+p.getUsername());
        this.role = p.getRole();
        this.phone = p.getPhone();
        this.adminStatus = "正常";
    }

}
